package modeles;

/**
 * 
 * Class modele contact
 * name					Objet String
 * firstName			Objet String
 * companyAddress		Objet String
 * personalPhone		Objet String
 * professionalPhone	Objet String
 * homePage				Objet String
 * email				Objet String
 * picture				Objet String     
 * other				Objet String
 * group				Objet String
 * 
 * @author Paul BEZARD-FALGAS
 *
 */
public class Contact implements Comparable<Contact> { 

	private String name;
	private String firstName;
	private String companyAddress;
	private String personalPhone;
	private String professionalPhone;
	private String homePage;
	private String email;
	private String picture;
	private String other;
	private String group;
	
	public String getStringInfo(){
		String s=null;
		s = this.getName() + ";" + this.getFirstName() + ";" + this.getCompanyAddress() + ";" + this.getPersonalPhone() + ";" + this.getProfessionalPhone() +
				";" + this.getHomePage() + ";" + this.getEmail() + ";" + this.getPicture() + ";" + this.getOther() + ";" + this.getGroup() + "\n";
		return s;	
	}
	
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCompanyAddress() {
		return companyAddress;
	}
	public void setCompanyAddress(String companyAddress) {
		this.companyAddress = companyAddress;
	}
	public String getPersonalPhone() {
		return personalPhone;
	}
	public void setPersonalPhone(String personalPhone) {
		this.personalPhone = personalPhone;
	}
	public String getProfessionalPhone() {
		return professionalPhone;
	}
	public void setProfessionalPhone(String professionalPhone) {
		this.professionalPhone = professionalPhone;
	}
	public String getHomePage() {
		return homePage;
	}
	public void setHomePage(String homePage) {
		this.homePage = homePage;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getPicture() {
		return picture;
	}
	public void setPicture(String picture) {
		this.picture = picture;
	}
	public String getOther() {
		return other;
	}
	public void setOther(String other) {
		this.other = other;
	}
	public String getGroup() {
		return group;
	}
	public void setGroup(String grp) {
		this.group = grp;
	}
	
	@Override
	public int compareTo(Contact other) {
		String nom1 = ((Contact) other).getName();
		String nom2 = this.getName();
		if(nom1.compareTo(nom2)<0) return 1;
		else if (nom1.compareTo(nom2)==0) return 0;
		else return -1;
	}
}
